﻿namespace TC
{
    public class MoveTo_tree : TranslateTree
    {
        public override editor.cfg.behaviourtree.TreeNode OnTranslate(Node node)
        {
            MoveTo t = node as MoveTo;
            editor.cfg.behaviourtree.MoveToExample re = new editor.cfg.behaviourtree.MoveToExample();
            re.id = t.id;

            Port p = t.graph.GetConnect(t.target);
            if (p != null)
            {
                re.obj = new editor.cfg.blueprint.OutputPin() { nodeId = p.parent.id, pinName = p.name };
            }
            p = t.graph.GetConnect(t.dest);
            if (p != null)
            {
                re.target = new editor.cfg.blueprint.OutputPin() { nodeId = p.parent.id, pinName = p.name };
            }
            return re;
        }
    }
}
